package com.fh.common;


public class ResultData {
    private Integer code;
    private String msg;
    private Object data;

    public static ResultData success(Object data){
        ResultData rs = new ResultData();
        rs.setCode(200);
        rs.setMsg("success");
        rs.setData(data);
        return rs;
    }

    public static ResultData error(Integer code,String msg){
        ResultData rs = new ResultData();
        rs.setCode(code);
        rs.setMsg(msg);
        rs.setData(null);
        return rs;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
